const crypto = require('crypto');

class ClickInfo {
    constructor(click_info_md5, target_url_md5, current_url_md5,html,iframe) {
        this.click_info_md5 = click_info_md5;
        this.x_y = '0';
        this.target_url_md5 = target_url_md5;
        this.current_url_md5 = current_url_md5; // corrected variable name
        this.html = html;
        this.is_frame = iframe;
    }

    getInsertSql() {
        return `INSERT INTO click_info(id, click_info_md5, x_y, target_url_md5, current_url_md5, html,is_frame) VALUES ($1, $2, $3, $4, $5,$6,$7)`;
    }

    getInsertValues() {
        let id = crypto.randomUUID(); // generate a new UUID for id
        let values = [id, this.click_info_md5, this.x_y, this.target_url_md5, this.current_url_md5, this.html, this.is_frame];
        return values;
    }
}

module.exports = ClickInfo;
